package com.hrsoft.edi.stub.request;

import com.hrsoft.edi.stub.internal.ApiListItem;
import com.qimen.api.QimenRequest;
import com.qimen.api.response.InventoryReportResponse;
import com.taobao.api.ApiRuleException;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.mapping.ApiListField;
import com.taobao.api.internal.util.RequestCheckUtils;

import java.util.List;
import java.util.Map;

public class InventoryReportRequest extends QimenRequest<InventoryReportResponse>
{
    private String adjustType;

    private String checkOrderCode;

    private String checkOrderId;

    private String checkTime;

    private Long currentPage;

    private Map extendProps;

    @ApiListField("items")
    @ApiField("item")
    private List<InventoryReportRequest.Item> items;

    private String orderType;

    private String outBizCode;

    private String ownerCode;

    private Long pageSize;

    private String remark;

    private Long totalPage;

    private String warehouseCode;

    private String apiMethodName = "inventory.report";

    public InventoryReportRequest()
    {
    }

    public void setAdjustType(String adjustType)
    {
        this.adjustType = adjustType;
    }

    public String getAdjustType()
    {
        return this.adjustType;
    }

    public void setCheckOrderCode(String checkOrderCode)
    {
        this.checkOrderCode = checkOrderCode;
    }

    public String getCheckOrderCode()
    {
        return this.checkOrderCode;
    }

    public void setCheckOrderId(String checkOrderId)
    {
        this.checkOrderId = checkOrderId;
    }

    public String getCheckOrderId()
    {
        return this.checkOrderId;
    }

    public void setCheckTime(String checkTime)
    {
        this.checkTime = checkTime;
    }

    public String getCheckTime()
    {
        return this.checkTime;
    }

    public void setCurrentPage(Long currentPage)
    {
        this.currentPage = currentPage;
    }

    public Long getCurrentPage()
    {
        return this.currentPage;
    }

    public void setExtendProps(Map extendProps)
    {
        this.extendProps = extendProps;
    }

    public Map getExtendProps()
    {
        return this.extendProps;
    }

    public void setItems(List<Item> items)
    {
        this.items = items;
    }

    public List<Item> getItems()
    {
        return this.items;
    }

    public void setOrderType(String orderType)
    {
        this.orderType = orderType;
    }

    public String getOrderType()
    {
        return this.orderType;
    }

    public void setOutBizCode(String outBizCode)
    {
        this.outBizCode = outBizCode;
    }

    public String getOutBizCode()
    {
        return this.outBizCode;
    }

    public void setOwnerCode(String ownerCode)
    {
        this.ownerCode = ownerCode;
    }

    public String getOwnerCode()
    {
        return this.ownerCode;
    }

    public void setPageSize(Long pageSize)
    {
        this.pageSize = pageSize;
    }

    public Long getPageSize()
    {
        return this.pageSize;
    }

    public void setRemark(String remark)
    {
        this.remark = remark;
    }

    public String getRemark()
    {
        return this.remark;
    }

    public void setTotalPage(Long totalPage)
    {
        this.totalPage = totalPage;
    }

    public Long getTotalPage()
    {
        return this.totalPage;
    }

    public void setWarehouseCode(String warehouseCode)
    {
        this.warehouseCode = warehouseCode;
    }

    public String getWarehouseCode()
    {
        return this.warehouseCode;
    }

    public String getApiMethodName()
    {
        return apiMethodName;
    }

    public void setApiMethodName(String apiMethodName)
    {
        this.apiMethodName = apiMethodName;
    }

    public Class<InventoryReportResponse> getResponseClass()
    {
        return InventoryReportResponse.class;
    }

    public void check()
        throws ApiRuleException
    {
        RequestCheckUtils.checkNotEmpty(this.adjustType, "adjustType");
        RequestCheckUtils.checkMaxLength(this.adjustType, 50, "adjustType");
        RequestCheckUtils.checkNotEmpty(this.checkOrderCode, "checkOrderCode");
        RequestCheckUtils.checkMaxLength(this.checkOrderCode, 50, "checkOrderCode");
        RequestCheckUtils.checkMaxLength(this.checkOrderId, 50, "checkOrderId");
        RequestCheckUtils.checkMaxLength(this.checkTime, 19, "checkTime");
        RequestCheckUtils.checkNotEmpty(this.currentPage, "currentPage");
        RequestCheckUtils.checkNotEmpty(this.outBizCode, "outBizCode");
        RequestCheckUtils.checkMaxLength(this.outBizCode, 50, "outBizCode");
        RequestCheckUtils.checkNotEmpty(this.ownerCode, "ownerCode");
        RequestCheckUtils.checkMaxLength(this.ownerCode, 50, "ownerCode");
        RequestCheckUtils.checkNotEmpty(this.pageSize, "pageSize");
        RequestCheckUtils.checkMaxLength(this.remark, 500, "remark");
        RequestCheckUtils.checkNotEmpty(this.totalPage, "totalPage");
        RequestCheckUtils.checkNotEmpty(this.warehouseCode, "warehouseCode");
        RequestCheckUtils.checkMaxLength(this.warehouseCode, 50, "warehouseCode");
    }

    public static class Item
    {
        @ApiField("batchCode")
        private String batchCode;

        @ApiField("expireDate")
        private String expireDate;

        @ApiField("inventoryType")
        private String inventoryType;

        @ApiField("itemCode")
        private String itemCode;

        @ApiField("ownerCode")
        private String ownerCode;

        @ApiField("productDate")
        private String productDate;

        @ApiField("quantity")
        private Long quantity;

        @ApiField("remark")
        private String remark;

        @ApiField("snCode")
        private String snCode;

        @ApiField("warehouseCode")
        private String warehouseCode;

        @ApiListItem(value = "sn",rootName="snList")
        private List<String> snList;

        public Item()
        {
        }

        public List<String> getSnList()
        {
            return snList;
        }

        public void setSnList(List<String> snList)
        {
            this.snList = snList;
        }

        public String getBatchCode()
        {
            return this.batchCode;
        }

        public void setBatchCode(String batchCode)
        {
            this.batchCode = batchCode;
        }

        public String getExpireDate()
        {
            return this.expireDate;
        }

        public void setExpireDate(String expireDate)
        {
            this.expireDate = expireDate;
        }

        public String getInventoryType()
        {
            return this.inventoryType;
        }

        public void setInventoryType(String inventoryType)
        {
            this.inventoryType = inventoryType;
        }

        public String getItemCode()
        {
            return this.itemCode;
        }

        public void setItemCode(String itemCode)
        {
            this.itemCode = itemCode;
        }

        public String getOwnerCode()
        {
            return this.ownerCode;
        }

        public void setOwnerCode(String ownerCode)
        {
            this.ownerCode = ownerCode;
        }

        public String getProductDate()
        {
            return this.productDate;
        }

        public void setProductDate(String productDate)
        {
            this.productDate = productDate;
        }

        public Long getQuantity()
        {
            return this.quantity;
        }

        public void setQuantity(Long quantity)
        {
            this.quantity = quantity;
        }

        public String getRemark()
        {
            return this.remark;
        }

        public void setRemark(String remark)
        {
            this.remark = remark;
        }

        public String getSnCode()
        {
            return this.snCode;
        }

        public void setSnCode(String snCode)
        {
            this.snCode = snCode;
        }

        public String getWarehouseCode()
        {
            return this.warehouseCode;
        }

        public void setWarehouseCode(String warehouseCode)
        {
            this.warehouseCode = warehouseCode;
        }
    }
}